package io.xxx.walle.room;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Optional;

@RestController
@RequestMapping("/roomGroup")
public class RoomGroupController {

    @Resource
    private RoomGroupRepository roomGroupRepository;

    @Resource
    private RoomGroupService roomGroupService;

    @GetMapping("/{id}")
    public Optional<RoomGroup> get(@PathVariable Long id) {
        return roomGroupRepository.findById(id);
    }

    @PostMapping("/addRooms")
    public void addRooms(@RequestBody RoomGroup roomGroup) {
        roomGroupService.addRooms(roomGroup);
    }
}
